import Vue from "vue"
import VueRouter from "vue-router"
import discover from "@/pages/discover"
import friend from "@/pages/friend"


Vue.use(VueRouter)
let routes = [
    {
        path:"/discover",
        component:discover ,
        redirect:"/discover/playlist",
        children: [
            {
                path: "playlist",
                component: () => import("@/pages/discover/playlist"),
                name:'playlist'
            },
            {
                path: "djradio",
                component: () => import("@/pages/discover/djradio")
            }
        ]

    },
    {
        path:"/friend/:id",
        component:friend
    },
    {
        path:"/mine",
        component:()=>import(/*webpackChunkName:'mine'*/"@/pages/mine") ,
        name:'mine'
    },
    {
        path:"/list",
        component:()=>import("@/pages/list")
    },
    {
        path:"/detail/:productid",
        props:true,
        component:()=>import("@/pages/detail")
    },
    {
        path:"*",
        component:()=>import("@/pages/page404")
    },
];
let router = new VueRouter({
    
    routes
})

export default router